package com.refuel.configuration;

import com.refuel.interceptor.RequestInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author zhanghao
 * @description 添加mvc支持
 * @date 2024/4/12 00:25
 **/
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Resource
    protected RequestInterceptor requestInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(requestInterceptor).addPathPatterns("/user/**");
    }

}
